import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login/index'
import Layout from '@/views/layout/index.vue'
import Home from '@/views/home/index.vue'
import Wenda from '@/views/wenda/index.vue'
import Video from '@/views/video/index.vue'
import Mine from '@/views/mine/index.vue'
import Search from '@/views/search/index.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/login', name: 'Login', component: Login },
  {
    path: '/layout',
    redirect: '/home',
    component: Layout,
    children: [
      { path: '/home', name: 'Home', component: Home },
      { path: '/wenda', name: 'Wenda', component: Wenda },
      { path: '/video', name: 'Video', component: Video },
      { path: '/mine', name: 'Mine', component: Mine }
    ]
  },
  { path: '/search', name: 'Search', component: Search }
]

const router = new VueRouter({
  routes
})

export default router
